package com.rgz.controller.wgController;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.rgz.mapper.PolicyMapper;
import com.rgz.mapper.UserInsuredMapper;
import com.rgz.mapper.UserMapper;
import com.rgz.pojo.Policy;
import com.rgz.pojo.PolicyExample;
import com.rgz.pojo.PolicyExample.Criteria;
import com.rgz.pojo.User;
import com.rgz.pojo.UserInsured;
import com.rgz.pojo.UserInsuredExample;
import com.rgz.redis.JedisUtil;
import com.rgz.service.WgService.UserService;

@Controller
public class SelectController {
	@Autowired
	private UserService userService;
	@Autowired
	private UserMapper userMapper;
	@RequestMapping("test")
	public String idbang1(){
		User user = new User();
		user.setUserphone("999999");
		List<User> selectByExample = userMapper.selectByExample(null);
		return "WGClaimsQuery";
	}
	@RequestMapping("test2")
	public String idbang2(){
		User user = new User();
		user.setUserphone("999999");
		userMapper.insert(user);
		return "WGClaimsQuery";
	}
	
	
	@RequestMapping("idbang")
	public String idbang(String idcare,HttpServletRequest request){
		//获取手机号
		User user = (User)request.getSession().getAttribute("user");
		String userphone = user.getUserphone();
		Integer i = userService.idbang(idcare, userphone);
		if(i>0){
			return "wzw_bdcg";
		}
		return "redirect:/user_WGSelfHelp";
	}
	@RequestMapping("wzw_ajxq")
	public String wzw_ajxq(){
		return "wzw_ajxq";
	}
	@RequestMapping("wzw_wxts2")
	public String wzw_wxts2(){
		return "wzw_wxts2";
	}
	
	
}
